<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>区划分类</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/dtree.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/font/dtreefont.css"/>
    <link rel="stylesheet" href="../../assets/module/admin.css?v=313"/>
    <link rel="stylesheet" href="../../assets/css/publicStyle.css"/>
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <style>
        #regionClass-tmpl-box .layui-form-select{
            float: right;
            margin-left: 15px;
        }
        .ztree *{
            font-size: 14px!important;
            font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif!important;
            color: #666;
        }
        #regionClassForm .layui-edge{
            right: 40px;
        }
        #regionClassForm .text-right,#editClassForm .text-right{
            margin: 30px 0;
        }
    </style>
</head>
<body class="layui-layout-body hide-body-title">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card-body">
                        <div class="layui-form toolbar">
                            <div class="layui-card-header">
                                区划分类
                            </div>
                            <div class="layui-card-body mini-bar" >
                                <div id="regionClass-tmpl-box"></div>
                                <ul id="regionClassTree" class="ztree" ></ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card-body">
                        <div class="layui-form toolbar">
                            <div class="layui-card-header">
                                区划树
                            </div>
                            <div class="layui-card-body mini-bar" >
                                <div id="regionTree-tmpl-box"></div>
                                <ul id="regionTree" class="ztree" ></ul>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--新增分类弹窗-->
<script type="text/html" id="addClassifyForm">
    <form id="regionClassForm" lay-filter="regionClassForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入分类名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">区划配置</label>
            <div class="layui-input-block" id="add-class-catalog">
                <select name="rcid" lay-filter="regionCatalog" id="addClassRegionCatalog" lay-verify="required" >

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">区划类型</label>
            <div class="layui-input-block" id="add-class-region">
                <select name="regionClass" lay-filter="regionClass" id="addClassRegionClass" lay-verify="required" >

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>确定</button>
        </div>
    </form>
</script>

<!--编辑分类弹窗-->
<script type="text/html" id="editClassModel">
    <form id="editClassForm" lay-filter="editClassForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入分类名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="editClassSubmit" lay-submit>确定</button>
        </div>
    </form>
</script>

<!-- 区划分类权限 -->
<script type="text/tmpl" id="regionClass-tmpl">
<div class="layui-form" action="" lay-filter="example">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{ if hasPower("/region/class:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="add-btn-class" >
                    <i class="layui-icon">&#xe654;</i>新增
                </button>

                {{/if}}
                {{ if hasPower("/region/class:edit")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="edit-btn-class" >
                    <i class="layui-icon">&#xe654;</i>编辑
                </button>
                {{/if}}
                {{ if hasPower("/region/class:delete")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="delete-btn-class">
                    <i class="layui-icon">&#xe640; </i>删除
                </button>
                {{/if}}
                {{ if hasPower("/region/class:queryTree")}}
                    <select name="rcid" lay-filter="CatalogVersion" class="regionClassType" id="regionClassTypeBox">
                    </select>
                {{/if}}
            </div>
        </div>
    </div >
</script>

<!-- 区划配置模板 -->
<script type="text/tmpl" id="Catalog-tmpl">
    {{each records}}
        <option value="{{$value.id}}">{{$value.name}}</option>
    {{/each}}
</script>

<!-- 区划类型模板 -->
<script type="text/tmpl" id="region-class-tmpl">
    {{each data}}
        <option value="{{$value.code}}">{{$value.message}}</option>
    {{/each}}
</script>

<!-- 区划分类权限 -->
<script type="text/tmpl" id="regionTree-tmpl">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{ if hasPower("/region/tree:update")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="update-btn-rinfo" >
                    <i class="layui-icon">&#xe669;</i>更新
                </button>
                {{/if}}
            </div>
        </div>
</script>

<!-- js部分 -->
<script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../assets/js/common.js?v=313"></script>
<script src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>

<!-- Ztree树部分 -->
<link rel="stylesheet" href="../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css"/>
<script src="../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>
<script src="../../assets/libs/copy/clipboard.min.js"></script>

<script src="../../assets/libs/template-web.js"></script>
<script src="../../assets/libs/axios.min.js"></script>
<script src="../../assets/js/config.js"></script>
<script src="../../assets/js/authority.js"></script>

<script src="../../assets/js/config/region.js"></script>
<script src="../../assets/js/region/regionClass.js"></script>
</body>

</html>